package de.silvalauinger.objectclassmapper.schema.system.attribute;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static de.silvalauinger.objectclassmapper.schema.DefaultSchemaManagerFactory.SCHEMA_MANAGER;
import static org.apache.directory.shared.ldap.model.constants.SchemaConstants.ALIASED_OBJECT_NAME_AT_OID;
import org.apache.directory.shared.ldap.model.name.Dn;
import org.apache.directory.shared.ldap.model.schema.AttributeType;

public final class AliasedObjectName {

    //<editor-fold defaultstate="collapsed" desc="Statics">
    public final static AttributeType ATTRIBUTE_TYPE = checkNotNull(SCHEMA_MANAGER.getAttributeType(ALIASED_OBJECT_NAME_AT_OID));
    //</editor-fold>
    //<editor-fold defaultstate="collapsed" desc="Attributes">
    private final Dn aliasedObjectName;
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="Constructors">
    public AliasedObjectName(final Dn aliasedObjectName) {
        checkArgument(!Dn.isNullOrEmpty(aliasedObjectName), "%s must not be null or empty.", "aliasedObjectName");
        this.aliasedObjectName = aliasedObjectName;
    }
    //</editor-fold>

    @Override
    public String toString() {
        return aliasedObjectName.toString();
    }
}
